import { createRouter, createWebHistory } from 'vue-router'


const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      component: () => import('@/pages/MainPage.vue')
    },
    {
      path: '/home',
      name: '主页',
      component: () => import('@/pages/HomePage.vue')
    },
    {
      path: '/user/login',
      name: '用户登录',
      component: () => import('@/pages/user/UserLoginPage.vue')
    },
    {
      path: '/user/register',
      name: '用户注册',
      component: () => import('@/pages/user/UserRegisterPage.vue')
    },
    {
      path: '/user/admin',
      name: '用户管理',
      component: () => import('@/pages/admin/UserManagerPage.vue')
    },
    {
      path: '/add_picture',
      name: '创建图片',
      component: () => import('@/pages/AddPicturePage.vue')
    },
    {
      path: '/picture/admin',
      name: '图片管理',
      component: () => import('@/pages/admin/PictureManagerPage.vue')
    },
    {
      path: '/picture/:id',
      name: '图片详情',
      component: () => import('@/pages/PictureDetailPage.vue')
    },
    {
      path: '/add_picture/batch',
      name: '批量创建图片',
      component: () => import('@/pages/admin/BatchAddPicturePage.vue'),
    },
    {
      path: '/space/admin',
      name: '空间管理',
      component: () => import('@/pages/admin/SpaceManager.vue'),
    },
    {
      path: '/add_space',
      name: '创建空间',
      component: () => import('@/pages/AddSpacePage.vue'),
    },
    {
      path: '/my_space',
      name: '我的空间',
      component: () => import('@/pages/MySpacePage.vue')
    },
    {
      path: '/space/:id',
      name: '空间详情',
      component: () => import('@/pages/SpaceDetailPage.vue')
    },
    {
      path: '/search_picture',
      name: '图片搜索',
      component: () => import('@/pages/SearchPicturePage.vue'),
    }
  ],
})

export default router
